﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace BgWorks.Models
{
    public class JobData
    {
        //-------------------Api的参数
        public string url { get; set; }
        public string resource { get; set; }
        public string value { get; set; }
        public int timeout { get; set; } = 5000;
        public string headers { get; set; }
        public string methodname { get; set; }

        //------------------sql的参数------------
        public string SqlType { get; set; }
        public string Sql { get; set; }
        public string Connectionkey { get; set; }
        public string ConnectionString { get; set; }
        //-----------------调用dll的参数---
        /// <summary>
        /// xxx.dll
        /// </summary>
        public string DllName { get; set; }
        /// <summary>
        /// 命名空间+类名
        /// </summary>
        public string DllSpace { get; set; }
        /// <summary>
        /// 方法名
        /// </summary>
        public string DllMethod { get; set; }

        /// <summary>
        /// 参数
        /// </summary>
        public string Args { get; set; }

        public override string ToString()
        {
            string str = "";
            if (DllName != null)
            {
                str += ">" + DllName;
            }
            if (DllSpace != null)
            {
                str += ">" + DllSpace;
            }
            if (DllMethod != null)
            {
                str += ">" + DllMethod;
            }
            return str;
        }
    }
}
